import Vue from 'vue'
import VueRouter from 'vue-router'

import Router from 'vue-router'

const originalPush = Router.prototype.push
Router.prototype.push = function push(location, onResolve, onReject) {
  if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
  return originalPush.call(this, location).catch(err => err)
}

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'IndexView',
    component: () => import('../views/IndexView.vue')
  },
  {
    path: '/LoginView',
    name: 'LoginView',
    component: () => import('../views/LoginView.vue')
  },

  {
    path: '/IndexView',
    name: 'IndexView',
    component: () => import('../views/IndexView.vue')
  },
  {
    path: '/SupplierView',
    name: 'SupplierView',
    component: () => import('../views/SupplierView.vue')
  },
  {
    path: '/CustomerView',
    name: 'CustomerView',
    component: () => import('../views/CustomerView.vue')
  },

  {
    path: '/CustomerConuntView',
    name: 'CustomerConuntView',
    component: () => import('../views/CustomerConuntView.vue')
  },

  {
    path: '/PurchaseView',
    name: 'PurchaseView',
    component: () => import('../views/PurchaseView.vue')
  },


  {
    path: '/PurchaseInfoView',
    name: 'PurchaseInfoView',
    component: () => import('../views/PurchaseInfoView.vue')
  },

  {
    path: '/SalesCountView',
    name: 'SalesCountView',
    component: () => import('../views/SalesCountView.vue')
  },

  {
    path: '/RetrievaView',
    name: 'RetrievaView',
    component: () => import('../views/RetrievaView.vue')
  },

  {
    path: '/SalesInfoView',
    name: 'SalesInfoView',
    component: () => import('../views/SalesInfoView.vue')
  },

  {
    path: '/InventoryView',
    name: 'InventoryView',
    component: () => import('../views/InventoryView.vue')
  },

  {
    path: '/UserView',
    name: 'UserView',
    component: () => import('../views/UserView.vue')
  },
  {
    path: '/RoleView',
    name: 'RoleView',
    component: () => import('../views/RoleView.vue')
  },

  {
    path: '/ChangePwdView',
    name: 'ChangePwdView',
    component: () => import('../views/ChangePwdView.vue')
  },

  {
    path: '/LogView',
    name: 'LogView',
    component: () => import('../views/LogView.vue')
  },

  //******************************************************************************

  {
    path: '/addUser',
    name: 'addUser',
    component: () => import('../components/addUser.vue')
  },

  // {
  //   path: '/changeGrade',
  //   name: 'changeGrade',
  //   component: () => import('../components/changeGrade.vue')
  // },

  {
    path: '/FindSupplier',
    name: 'FindSupplier',
    component: () => import('../components/FindSupplier.vue')
  },


  {
    path: '/changeSupplier',
    name: 'changeSupplier',
    component: () => import('../components/changeSupplier.vue')
  },

  {
    path: '/BuyList',
    name: 'BuyList',
    component: () => import('../components/BuyList.vue')
  },

  {
    path: '/FindCustomer',
    name: 'FindCustomer',
    component: () => import('../components/FindCustomer.vue')
  },

  {
    path: '/SaleList',
    name: 'SaleList',
    component: () => import('../components/SaleList.vue')
  },

  {
    path: '/SelectClient',
    name: 'SelectClient',
    component: () => import('../components/SelectClient.vue')
  },

  {
    path: '/AddClient',
    name: 'AddClient',
    component: () => import('../components/AddClient.vue')
  },


  {
    path: '/ShowAdd',
    name: 'ShowAdd',
    component: () => import('../components/ShowAdd.vue')
  },
  {
    path: '/ShowAdd2',
    name: 'ShowAdd2',
    component: () => import('../components/ShowAdd2.vue')
  },


  {
    path: '/AddProvider',
    name: 'AddProvider',
    component: () => import('../components/AddProvider.vue')
  },

  {
    path: '/UpdateProvider',
    name: 'UpdateProvider',
    component: () => import('../components/UpdateProvider.vue')
  },


  {
    path: '/SelectClient',
    name: 'SelectClient',
    component: () => import('../components/SelectClient.vue')
  },

  {
    path: '/UpdateClient',
    name: 'UpdateClient',
    component: () => import('../components/UpdateClient.vue')
  },

  {
    path: '/BuyList',
    name: 'BuyList',
    component: () => import('../components/BuyList.vue')
  },

  {
    path: '/CargoInfo',
    name: 'CargoInfo',
    component: () => import('../components/CargoInfo.vue')
  },


  {
    path: '/SaleList',
    name: 'SaleList',
    component: () => import('../components/SaleList.vue')
  },

  {
    path: '/UpdateCargoSaleMoney',
    name: 'UpdateCargoSaleMoney',
    component: () => import('../components/UpdateCargoSaleMoney.vue')
  },







]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
